Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chad Rosenthal 272 posts 474 karma points
    Apr 26, 2011 @ 16:38
    Chad Rosenthal
    0

    Method returning {localLink:1058}

    I'm currently creating a /base method that returns content from a Rich Text Editor to display in an AJAX Form. (Umbraco 4.7).

    My method is:

    outputText = umbraco.library.HtmlEncode(thankYouNode.GetProperty("mainContent").Value);

    And the output to the screen is:

    <p><a href="/{localLink:1058}" title="Home">link</a></p>

    Obviously not ideal. Any ideas?


     

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Apr 26, 2011 @ 17:05
    Tom Fulton
    5

    Hi Chad,

    Try running the content through:

    umbraco.template.ParseInternalLinks(string pageContents)

    This usually gets handled by the template rendering but since you're using a base method I think you'll need to account for it yourself.

    Hope this helps,
    Tom

  • Chad Rosenthal 272 posts 474 karma points
    Apr 26, 2011 @ 17:27
    Chad Rosenthal
    0

    that worked perefectly. Thanks!

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Apr 26, 2011 @ 18:21
  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Dec 05, 2012 @ 17:43
    Ali Sheikh Taheri
    0

    Thanks Tom, I had the same problem.

    I had a page that generates json for specific pages. the bodyText content wasn't translating the internal links to NiceUrl. 

    I used the same method and it works great but I believe that has to be done automatically.

    Cheers

    Ali

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies